import { CSGOperation, Evaluator } from '../imports';
import { Brush3D } from './Brush3D';

export class Evaluator3D
{
    _evaluator: Evaluator;

    constructor()
    {
        this._evaluator = new Evaluator();
    }

    get useGroups()
    {
        return this._evaluator.useGroups;
    }
    set useGroups(v)
    {
        this._evaluator.useGroups = v;
    }

    evaluate(a: Brush3D, b: Brush3D, operation: CSGOperation, targetBrush?: Brush3D)
    {
        const brush = this._evaluator.evaluate(a._mesh, b._mesh, operation, targetBrush?._mesh);

        const brush3D = Brush3D.get(brush);

        return brush3D;
    }
}
